Precision Formation Flying is an enabling technology for a variety of proposed space-based observatories, including the Micro-Arcsecond X-ray Imaging Mission (MAXIM), the associated MAXIM pathfinder mission, and the Stellar Imager. An essential element of the technology is the control algorithm. This paper discusses the development of a nonlinear, six-degree of freedom (6DOF) control algorithm for maintaining the relative position and attitude of a spacecraft within a formation. The translation dynamics are based on the equations of motion for the restricted three body problem. The control law guarantees the tracking error convergences to zero, based on a Lyapunov analysis. The simulation, modelled after the MAXIM Pathfinder mission, maintains the relative position and attitude of a Follower spacecraft with respect to a Leader spacecraft, stationed near the L2 libration point in the Sun-Earth system.